package com.lelv.framework.plugin;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class LelvUtils {

	public static String createOrderNo(){

		Date date = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
		String time = sdf.format(date);
		Random ran = new Random();
		int num = Math.abs(ran.nextInt(10000));
		String order = time + String.valueOf(num);

		return order;
	}

	public static String createSystemFileName(String filename){

		int index = filename.indexOf(".");
		String endStr = filename.substring(index, filename.length());
		Date date = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
		String dateStr = sdf.format(date);
		StringBuffer newname = new StringBuffer(dateStr);
		newname.append(endStr);

		return newname.toString();
	}
}
